raar.gui
Class RAGProcess

java.lang.Object
  extended by raar.gui.RAGProcess
All Implemented Interfaces:
java.io.Serializable

public class RAGProcess
extends java.lang.Object
implements java.io.Serializable

This class can draw a neat image of a process. Provide a graphics object of a bufferedimage on which the process has to be drawn.

You can create Buffered Image graphics with code like this (supposed you have a normal image called image):

BufferedImage buffer = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_3BYTE_BGR);
Graphics g = buffer.getGraphics();
g.drawImage(image,0,0,null);

See Also:
Serialized Form

Field Summary
static float alpha
          Determines the opacity of processes ranging from 0 (transparent) to 1 (opaque).
static java.awt.Color backgroundColor
          Determines the colour processes will be filled with.
static java.awt.Color backgroundColorActor
          Determines the colour actors will be filled with.
static java.awt.Color backgroundColorFactory
          Determines the colour factories will be filled with.
static java.awt.Color backgroundColorMonitor
          Determines the colour monitors will be filled with.
static java.awt.Color backgroundColorSelected
          Determines the colour the selected process will be filled with.
static java.awt.Color backgroundColorSensor
          Determines the colour sensors will be filled with.
static java.awt.Color backgroundColorSpecial
          Determines the colour special processes will be filled with.
static java.awt.Color foregroundColor
          Determines the colour the process lines and text will be drawn in.
static java.awt.Font ins
          Font for inputs and outputs.
static java.awt.Font prn
          Font for process name.
 
Constructor Summary
RAGProcess(RAProcess source)
          Construct the drawer with specified process.
 
Method Summary
 int getHeight()
          How high will the box of this process be?
 java.awt.Shape[] getInputShapes()
          Get the shapes that form the inputs of the process.
 java.awt.Shape[] getOutputShapes()
          Get the shapes that form the outputs of the process.
 RAProcess getProcess()
          Return the process we are drawing.
 java.awt.Image getSelected()
          Return the selected process image.
 java.awt.Image getUnselected()
          Return the unselected process image.
 void redraw()
          Redraw the process image (for example when something has changed in the process).
 void setProcess(RAProcess p)
          Set the process we are drawing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ins

public static final java.awt.Font ins
Font for inputs and outputs.


prn

public static final java.awt.Font prn
Font for process name.


foregroundColor

public static java.awt.Color foregroundColor
Determines the colour the process lines and text will be drawn in.


backgroundColor

public static java.awt.Color backgroundColor
Determines the colour processes will be filled with.


backgroundColorSpecial

public static java.awt.Color backgroundColorSpecial
Determines the colour special processes will be filled with.


backgroundColorMonitor

public static java.awt.Color backgroundColorMonitor
Determines the colour monitors will be filled with.


backgroundColorActor

public static java.awt.Color backgroundColorActor
Determines the colour actors will be filled with.


backgroundColorFactory

public static java.awt.Color backgroundColorFactory
Determines the colour factories will be filled with.


backgroundColorSensor

public static java.awt.Color backgroundColorSensor
Determines the colour sensors will be filled with.


backgroundColorSelected

public static java.awt.Color backgroundColorSelected
Determines the colour the selected process will be filled with.


alpha

public static float alpha
Determines the opacity of processes ranging from 0 (transparent) to 1 (opaque).

Constructor Detail

RAGProcess

public RAGProcess(RAProcess source)
Construct the drawer with specified process.

Method Detail

getProcess

public RAProcess getProcess()
Return the process we are drawing.


setProcess

public void setProcess(RAProcess p)
Set the process we are drawing.


redraw

public void redraw()
Redraw the process image (for example when something has changed in the process).


getUnselected

public java.awt.Image getUnselected()
Return the unselected process image.


getSelected

public java.awt.Image getSelected()
Return the selected process image.


getHeight

public int getHeight()
How high will the box of this process be?


getInputShapes

public java.awt.Shape[] getInputShapes()
Get the shapes that form the inputs of the process.


getOutputShapes

public java.awt.Shape[] getOutputShapes()
Get the shapes that form the outputs of the process.